package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @Author: PengFei.He
 * @Date: 2024/11/6 19:48
 * @Function:
 */
@Data
@TableName("book")
public class Book implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @TableField("name")
    private String name;

    @TableField("price")
    private String price;

    @TableField("author")
    private String author;

    @TableField("press")
    private String press;

    @TableField("img")
    private String img;

    // 图书分类的id
    @TableField("typeId")
    private String typeId;

    // 图书介绍
    @TableField("content")
    private String content;

    // 图书分类名，这个字段不要映射到表中
    @TableField(exist = false)
    private String typeName;
}
